package com.yangcangclub.system.domain;

import com.yangcangclub.system.base.SystemBaseDomain;
import com.google.common.collect.Maps;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 个人推送配置
 */
@Component
public class Sequence extends SystemBaseDomain {


    /**
     * 当前系列的下一个值
     */
    public int queryNextval(String key){
        Map<String,Object> map = Maps.newHashMap();
        map.put("key",key);
        return super.getSlaveJdbc().selectOne("system.SystemMapper.selectSequenceNextId", map);
    }


    /**
     * 当前系列的当前值
     */
    public int queryCurrval(String key){
        Map<String,Object> map = Maps.newHashMap();
        map.put("key",key);
        return super.getSlaveJdbc().selectOne("system.SystemMapper.selectSequenceCurId", map);
    }

}

